package learn.emp02.ex11;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        if (a>=0 && a<=9){
            System.out.println(Character.forDigit(a, 16));
        } else if (a>=10 && a<=15) {
            System.out.println((char)('A'+(a-10)));
        } else {
            System.out.println("Invalid input");
        }
    }
}
